home *** CD-ROM | disk | FTP | other *** search
- function setscreen(sc)
- {
- var _loc1_ = sc;
- if(_loc1_ == "back")
- {
- loopb = true;
- front[7]._visible = false;
- while(loopb)
- {
- loopb = false;
- screen = backscreen[screencounter];
- screencounter--;
- if(screencounter <= 1)
- {
- front[4].choice.gotoAndStop("new");
- }
- if(screen == "about" or screen == "help")
- {
- loopb = true;
- }
- }
- }
- else if(_loc1_ == "reset")
- {
- front[7]._visible = false;
- screencounter = 0;
- front[4].choice.gotoAndStop("new");
- }
- else
- {
- screencounter++;
- backscreen[screencounter] = screen;
- screen = _loc1_;
- }
- }
- function useweapon(who)
- {
- var _loc1_ = who;
- if(weaponcounter[_loc1_] >= 1 and mode[_loc1_] == "ground")
- {
- weaponcounter[_loc1_]--;
- if(weaponcounter[_loc1_] < 1)
- {
- weaponface.gotoAndStop(1);
- weapon[_loc1_] = null;
- }
- tracklength++;
- obstacles.attachMovie("obstacle",tracklength,tracklength);
- obstacles[tracklength].kind = weapon[_loc1_];
- if(_loc1_ == human)
- {
- obstacles[tracklength].human = true;
- }
- playsound("drop");
- if(xvel[_loc1_] > 0)
- {
- margin = -50;
- }
- else
- {
- margin = 20;
- }
- obstacles[tracklength]._x = bikes[_loc1_]._x - obstacles._x + margin;
- obstacles[tracklength]._y = bikes[_loc1_]._y - obstacles._y;
- }
- }
- function usextra(who)
- {
- if(xtra[who] == "fuel")
- {
- eval("xtraloop" + who).onEnterFrame = function()
- {
- if(!paused)
- {
- if(xtracounter[who] == 1 and who == human)
- {
- playsound("accel");
- damagebike(who,(0.08 + engine[who] / 3) * 5);
- }
- xtracounter[who]++;
- bikes[who].chase.b.gotoAndStop("horse");
- xvel[who] *= 1.05;
- if(xtracounter[who] > 99)
- {
- xtracounter[who] = 0;
- bikes[who].chase.b.horse.gotoAndPlay("off");
- delete eval("xtraloop" + who).onEnterFrame;
- }
- }
- };
- }
- else if(xtra[who] == "repair")
- {
- eval("xtraloop" + who).onEnterFrame = function()
- {
- if(!paused)
- {
- xvel[who] *= 0.8;
- damagebike(who,-0.1);
- if(damage[who] < 1)
- {
- delete eval("xtraloop" + who).onEnterFrame;
- }
- }
- };
- }
- }
- function changemoney(much)
- {
- money += much;
- mymoney = "$" + money;
- starsbox.gotoAndPlay(2);
- }
- function damagebike(which, much)
- {
- damage[which] += much + much * (4 - cauchomodel[which]) / 4;
- if(which == human)
- {
- heat.gotoAndStop(Math.floor(damage[which]));
- if(much > 0 and damage[which] > 20)
- {
- if(damage[which] < 50)
- {
- msg.txt = "HEATING!";
- }
- else if(damage[which] < 70)
- {
- msg.txt = "HEATING!";
- }
- else if(damage[which] < 100)
- {
- msg.txt = "OVERLOADING!";
- }
- else if(damage[which] > 100)
- {
- msg.txt = "ENGINE OVERLOADED!";
- }
- msg.gotoAndPlay(2);
- }
- }
- if(damage[which] > 100)
- {
- explodecounter[which] = 2;
- eval("xtraloop" + which).onEnterFrame = null;
- mytrack[which] = bikes[which]._y;
- yvel[which] = -15;
- mode[which] = "falling";
- keyb[which] = false;
- }
- }
- function forcewinners()
- {
- motorsnd.stop();
- tosort = new Array();
- winnerlist = new Array();
- n = 1;
- while(n <= muchbikes)
- {
- tosort[n] = kilometer[n];
- n++;
- }
- tosort.sort();
- n = 1;
- while(n <= muchbikes)
- {
- s = 1;
- while(s <= muchbikes)
- {
- if(tosort[n] == kilometer[s])
- {
- winnerlist[n] = s;
- }
- s++;
- }
- n++;
- }
- n = 1;
- while(n <= muchbikes)
- {
- tosort[n] = winnerlist[muchbikes - n + 1];
- n++;
- }
- muchwinners = muchbikes;
- if(muchwinners > 3)
- {
- muchwinners = 3;
- }
- while(arrived < muchwinners)
- {
- arrived++;
- f = 1;
- while(f <= muchwinners)
- {
- if(playerstate[tosort[f]] != "winner")
- {
- winner[arrived] = tosort[f];
- if(playerstate[tosort[f]] == "alive")
- {
- myminutes = 0;
- myseconds = Math.round(14 * (muchbikes + f) + random(10));
- if(myseconds > 60)
- {
- myseconds -= 60;
- if(myseconds < 10)
- {
- myseconds += "0";
- }
- myminutes++;
- }
- winnertime[arrived] = "0" + myminutes + ":" + myseconds + ":" + Math.round(Number(arrived * (random(7) + 10)));
- }
- else
- {
- if(bikers[tosort[f]] == bikers[human])
- {
- temphuman = bikers[human];
- }
- bikers[tosort[f]] = 7;
- winnertime[arrived] = "99:99:99";
- }
- playerstate[tosort[f]] = "winner";
- break;
- }
- f++;
- }
- }
- screen = "winners";
- front.play();
- paused = true;
- }
- function savegame()
- {
- saved.data.muchbikes = muchbikes;
- saved.data.biker = bikers[human];
- saved.data.saved = 1;
- saved.data.caucho = caucho;
- saved.data.motor = motor;
- saved.data.engine = engine[human];
- saved.data.cauchomodel = cauchomodel[human];
- saved.data.weapon = weapon[human];
- saved.data.weaponcounter = weaponcounter[human];
- saved.data.xtra = xtra[human];
- saved.data.money = money;
- }
- function loadgame()
- {
- muchbikes = human = saved.data.muchbikes;
- bikers[human] = models[human] = saved.data.biker;
- caucho = saved.data.caucho;
- motor = saved.data.motor;
- engine[human] = saved.data.engine;
- cauchomodel[human] = saved.data.cauchomodel;
- weapon[human] = saved.data.weapon;
- weaponcounter[human] = saved.data.weaponcounter;
- xtra[human] = saved.data.xtra;
- money = saved.data.money;
- mymoney = "$" + money;
- }
- function murdered()
- {
- if(murder == false)
- {
- murder = true;
- if(explodecounter[human] < 0)
- {
- damagebike(human,200);
- }
- if(winnercounter[human] > 0)
- {
- winnercounter[human] = -10;
- obstacles._x += 2;
- xvel[human] *= -10;
- bikes[human]._x -= 10;
- }
- mafiamission = "failed";
- paused = true;
- mafia.play();
- }
- }
- function soundbase(which)
- {
- sndtrack.stop();
- sndtrack = null;
- sndtrack = new Sound(snd1);
- sndtrack.attachSound(which);
- sndtrack.setVolume(60);
- sndtrack.start(0,999999999);
- }
- function playsound(which)
- {
- eventsound = null;
- eventsound = new Sound(snd2);
- eventsound.attachSound(which);
- eventsound.start();
- }
- _quality = "LOW";
- stop();
- gravity = 1;
- friction = 0.9;
- bounce = 0.3;
- human = 1;
- motorstarted = false;
- explodecounter = new Array();
- fadebike = new Array();
- cauchomodel = new Array();
- motorkind = new Array();
- engine = new Array();
- xvel = new Array();
- playerstate = new Array();
- yvel = new Array();
- bikelaps = new Array();
- kilpercent = new Array();
- kilometer = new Array();
- mode = new Array();
- mytrack = new Array();
- bikers = new Array();
- models = new Array();
- rampcounter = new Array();
- rotatecounter = new Array();
- oilcounter = new Array();
- tachuelascounter = new Array();
- gumcenter = new Array();
- gumcounter = new Array();
- poisoncounter = new Array();
- ongroundcounter = new Array();
- mytrackcounter = new Array();
- weapon = new Array();
- weaponcounter = new Array();
- xtra = new Array();
- xtracounter = new Array();
- xtracounter = new Array();
- keyb = new Array();
- damage = new Array();
- muchbikes = 4;
- n = 1;
- while(n <= muchbikes)
- {
- xvel[n] = 0.1;
- engine[n] = 1;
- cauchomodel[n] = 1;
- motorkind = 1;
- n++;
- }
- center = 300;
- rightcenter = center + center / 2;
- leftcenter = center - center / 2;
- trackcounter = 0;
- seconds = minutes = milliseconds = 0;
- heat[n].model.gotoAndStop(1);
- weaponitems = new Array();
- weaponitems[0] = "blank";
- weaponitems[1] = "banana";
- weaponitems[2] = "tachuelas";
- weaponitems[3] = "gum";
- weaponitems[4] = "poison";
- xtraitems = new Array();
- xtraitems[0] = "blank";
- xtraitems[1] = "repair";
- xtraitems[2] = "fuel";
- backscreen = new Array();
- muchbikes = 2;
- winnercounter = new Array();
- winner = new Array();
- winnertime = new Array();
- arrived = 0;
- obstaclekind = new Array();
- obstaclekind[0] = "grass";
- obstaclekind[1] = "jumper";
- obstaclekind[2] = "oil";
- obstaclekind[3] = "dumb";
- obstaclekind[4] = "ramp";
- obstaclekind[5] = "star";
- motor = "motor1";
- caucho = "caucho1";
- tracklength = 10;
- changemoney(150);
- order = new Array();
- saved = SharedObject.getLocal("sikidsrb");
- score = saved.data.score;
- playername = new Array();
- playername[1] = "rocket dude";
- playername[2] = "alien farm";
- playername[3] = "red gallito";
- playername[4] = "punk guy";
- playername[5] = "blue elvis";
- playername[6] = "evil clown";
- motorsnd = new Sound(snd3);
- motorsnd.attachSound("motorsnd");
-